using System.Web.UI;
using System.Web.UI.HtmlControls;

namespace FluentTags
{

    public class SupTag : Tag<SupTag>
    {
        public SupTag() : base("sup"){}
        
        public SupTag(string text) : this()
        {
            Controls.Add(new LiteralControl(text));
        }

        public SupTag(object value) : this()
        {
            Controls.Add(new LiteralControl(SafeString(value)));
        }
        
        
        public SupTag(Control control) : this()
        {
            Controls.Add(control);
        }
        
        
        
        
        public ATag<SupTag> A()
        {
            var ctrl = new ATag<SupTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag A(ATag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ATag<SupTag> A(string text)
        {
            var ctrl = new ATag<SupTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ATag<SupTag> A(Control control)
        {
            var ctrl = new ATag<SupTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ATag<SupTag> A(object value)
        {
            return A(SafeString(value));
        }
        
        public BTag<SupTag> B()
        {
            var ctrl = new BTag<SupTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag B(BTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public BTag<SupTag> B(string text)
        {
            var ctrl = new BTag<SupTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public BTag<SupTag> B(Control control)
        {
            var ctrl = new BTag<SupTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public BTag<SupTag> B(object value)
        {
            return B(SafeString(value));
        }
        
        public BRTag<SupTag> BR()
        {
            var ctrl = new BRTag<SupTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag BR(BRTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<SupTag> EM()
        {
            var ctrl = new EMTag<SupTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag EM(EMTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<SupTag> EM(string text)
        {
            var ctrl = new EMTag<SupTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public EMTag<SupTag> EM(Control control)
        {
            var ctrl = new EMTag<SupTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public EMTag<SupTag> EM(object value)
        {
            return EM(SafeString(value));
        }
        
        public ITag<SupTag> I()
        {
            var ctrl = new ITag<SupTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag I(ITag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ITag<SupTag> I(string text)
        {
            var ctrl = new ITag<SupTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ITag<SupTag> I(Control control)
        {
            var ctrl = new ITag<SupTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ITag<SupTag> I(object value)
        {
            return I(SafeString(value));
        }
        
        public ImgTag<SupTag> Img()
        {
            var ctrl = new ImgTag<SupTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag Img(ImgTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<SupTag> Span()
        {
            var ctrl = new SpanTag<SupTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag Span(SpanTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<SupTag> Span(string text)
        {
            var ctrl = new SpanTag<SupTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SpanTag<SupTag> Span(Control control)
        {
            var ctrl = new SpanTag<SupTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SpanTag<SupTag> Span(object value)
        {
            return Span(SafeString(value));
        }
        
        public StrongTag<SupTag> Strong()
        {
            var ctrl = new StrongTag<SupTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag Strong(StrongTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public StrongTag<SupTag> Strong(string text)
        {
            var ctrl = new StrongTag<SupTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public StrongTag<SupTag> Strong(Control control)
        {
            var ctrl = new StrongTag<SupTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public StrongTag<SupTag> Strong(object value)
        {
            return Strong(SafeString(value));
        }
        
        public SubTag<SupTag> Sub()
        {
            var ctrl = new SubTag<SupTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag Sub(SubTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SubTag<SupTag> Sub(string text)
        {
            var ctrl = new SubTag<SupTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SubTag<SupTag> Sub(Control control)
        {
            var ctrl = new SubTag<SupTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SubTag<SupTag> Sub(object value)
        {
            return Sub(SafeString(value));
        }
        
        public SupTag<SupTag> Sup()
        {
            var ctrl = new SupTag<SupTag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag Sup(SupTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SupTag<SupTag> Sup(string text)
        {
            var ctrl = new SupTag<SupTag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SupTag<SupTag> Sup(Control control)
        {
            var ctrl = new SupTag<SupTag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SupTag<SupTag> Sup(object value)
        {
            return Sup(SafeString(value));
        }
        
        
        public SupTag Text(string text)
        {
            Controls.Add(new LiteralControl(text));
            return this;
        }

        public SupTag Text(object value)
        {
            Controls.Add(new LiteralControl(SafeString(value)));
            return this;
        }
        
    }

    public class SupTag<ParentType> : ChildTag<SupTag<ParentType>, ParentType>
        where ParentType : HtmlGenericControl
    {
        public SupTag(ParentType parent) : base("sup", parent) { }

        
        
        
        public ATag<SupTag<ParentType>> A()
        {
            var ctrl = new ATag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag<ParentType> A(ATag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ATag<SupTag<ParentType>> A(string text)
        {
            var ctrl = new ATag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ATag<SupTag<ParentType>> A(Control control)
        {
            var ctrl = new ATag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ATag<SupTag<ParentType>> A(object value)
        {
            var ctrl = new ATag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public BTag<SupTag<ParentType>> B()
        {
            var ctrl = new BTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag<ParentType> B(BTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public BTag<SupTag<ParentType>> B(string text)
        {
            var ctrl = new BTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public BTag<SupTag<ParentType>> B(Control control)
        {
            var ctrl = new BTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public BTag<SupTag<ParentType>> B(object value)
        {
            var ctrl = new BTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public BRTag<SupTag<ParentType>> BR()
        {
            var ctrl = new BRTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag<ParentType> BR(BRTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<SupTag<ParentType>> EM()
        {
            var ctrl = new EMTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag<ParentType> EM(EMTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<SupTag<ParentType>> EM(string text)
        {
            var ctrl = new EMTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public EMTag<SupTag<ParentType>> EM(Control control)
        {
            var ctrl = new EMTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public EMTag<SupTag<ParentType>> EM(object value)
        {
            var ctrl = new EMTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public ITag<SupTag<ParentType>> I()
        {
            var ctrl = new ITag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag<ParentType> I(ITag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ITag<SupTag<ParentType>> I(string text)
        {
            var ctrl = new ITag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ITag<SupTag<ParentType>> I(Control control)
        {
            var ctrl = new ITag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ITag<SupTag<ParentType>> I(object value)
        {
            var ctrl = new ITag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public ImgTag<SupTag<ParentType>> Img()
        {
            var ctrl = new ImgTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag<ParentType> Img(ImgTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<SupTag<ParentType>> Span()
        {
            var ctrl = new SpanTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag<ParentType> Span(SpanTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<SupTag<ParentType>> Span(string text)
        {
            var ctrl = new SpanTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SpanTag<SupTag<ParentType>> Span(Control control)
        {
            var ctrl = new SpanTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SpanTag<SupTag<ParentType>> Span(object value)
        {
            var ctrl = new SpanTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public StrongTag<SupTag<ParentType>> Strong()
        {
            var ctrl = new StrongTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag<ParentType> Strong(StrongTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public StrongTag<SupTag<ParentType>> Strong(string text)
        {
            var ctrl = new StrongTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public StrongTag<SupTag<ParentType>> Strong(Control control)
        {
            var ctrl = new StrongTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public StrongTag<SupTag<ParentType>> Strong(object value)
        {
            var ctrl = new StrongTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public SubTag<SupTag<ParentType>> Sub()
        {
            var ctrl = new SubTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag<ParentType> Sub(SubTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SubTag<SupTag<ParentType>> Sub(string text)
        {
            var ctrl = new SubTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SubTag<SupTag<ParentType>> Sub(Control control)
        {
            var ctrl = new SubTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SubTag<SupTag<ParentType>> Sub(object value)
        {
            var ctrl = new SubTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public SupTag<SupTag<ParentType>> Sup()
        {
            var ctrl = new SupTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public SupTag<ParentType> Sup(SupTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SupTag<SupTag<ParentType>> Sup(string text)
        {
            var ctrl = new SupTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SupTag<SupTag<ParentType>> Sup(Control control)
        {
            var ctrl = new SupTag<SupTag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SupTag<SupTag<ParentType>> Sup(object value)
        {
            var ctrl = new SupTag<SupTag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        
        public SupTag<ParentType> Text(string text)
        {
            Controls.Add(new LiteralControl(text));
            return this;
        }
        
        public SupTag<ParentType> Text(object value)
        {
            Controls.Add(new LiteralControl(SafeString(value)));
            return this;
        }
        
        
    }
}